import java.util.ArrayList;
import java.util.List;

public class TestList {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("hello");
        list.add("hello1");
        list.add("hello2");
        list.add(0,"world");
        System.out.println(list);
        list.remove("hello2");
        list.remove(0);
        System.out.println(list.get(0));
        System.out.println(list);
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
        list.set(0, "hello00");
        System.out.println(list);

        List<String> list2 = new ArrayList<>();
        list2.add("list21");
        list2.add("list22");
        list2.add("list23");
        System.out.println(list2);
        list2.addAll(list);
        System.out.println(list2);
        list2.addAll(0, list);
        System.out.println(list2);
        list2.removeAll(list);
        System.out.println(list2);
    }
}
